package com.bamanker.authclient.feign;


import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * @author bamanker
 */
@Component
@FeignClient(value = "ResClient",url = "http://127.0.0.1:9200",fallback = ResFeignClientFallback.class)
public interface ResClient {

    /**
     * 绑定请求头 @RequestHeader
     */
    @GetMapping("/resource1")
    Object getRes1(@RequestHeader("Authorization") String accessToken);

    @GetMapping("/resource2")
    Object getRes2(@RequestHeader("Authorization") String accessToken);

    @GetMapping("/resource3")
    Object getRes3(@RequestHeader("Authorization") String accessToken);

    @GetMapping("/api/publicResource")
    Object getPublicRes(@RequestHeader("Authorization") String accessToken);

}
